cos = math.cos
sin = math.sin

header = {
   name = "oval",
   size = {4096 * 18, 3072 * 24},
   lap = 3,
}

player = {
   startpoint = {15353, 13535},
   weight     = 500;
   bbox       = {-50, -50, 50, 50};
   accel      = 1500,
   decel      = 0.9,
   routine = 1;
   tailcolor  = {1.0, 1.0, 1.0, 1.0}
}

rivallist = {
   alcor = {
      startpoint = {15353 + 100 * 0, 13535 + 100 * 1},
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel = 2500,
      decel = 800,
      routine = 0,
      tailcolor = {1.0, 1.0, 0.5, 0.7}
   };

   toge = {
      startpoint = {15353 + 100 * 1, 13535 + 100 * 0};
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel     = 2200;
      decel     = 800;
      routine   = 0;
      tailcolor = {1.0, 0.5, 0.5, 0.7};
   };

   hoge = {
      startpoint = {15353 + 100 * 1, 13535 + 100 * 1};
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel = 2300;
      decel = 800;
      routine = 0;
      tailcolor = {1.0, 0.0, 0.5, 0.7};
   };

   foo = {
      startpoint = {15353 + 100 * 2, 13535 + 100 * 0};
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel = 2400;
      decel = 800;
      routine = 0;
      tailcolor = {1.0, 0.5, 0.5, 0.7};
   };

   bar = {
      startpoint = {15353 + 100 * 2, 13535 + 100 * 1};
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel = 2500;
      decel = 800;
      routine = 1;
      tailcolor = {0.5, 0.5, 0.5, 0.7};
   };

   dare = {
      startpoint = {15353 + 100 * 3, 13535 + 100 * 0};
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel = 8000;
      decel = 800;
      routine = 1;
      tailcolor = {0.0, 0.5, 0.5, 0.7};
   };

   wasat = {
      startpoint = {15353 + 100 * 3, 13535 + 100 * 1};
      weight     = 500;
      bbox       = {-50, -50, 50, 50};
      accel = 2200;
      decel = 800;
      routine = 1;
      tailcolor = {0.0, 1.0, 1.0, 0.7};
   };
}

do
   for index = 1, 12 do
      rivallist["zako" .. index] = {
         startpoint = {
            15353 + 100 * (4 + index / 2),
            13535 + 100 * math.mod(index, 2),
         };
         weight     = 500;
         bbox       = {-50, -50, 50, 50};
         accel = 2200 - 300 * (math.mod(index, 3) - 1);
         decel = 0.9;
         routine = math.mod(index, 3);
         tailcolor = {math.random(), math.random(), math.random(), 0.7};
      }
   end
end

targetlist = {};

do 
   local x = header.size[1] / 2
   local y = header.size[2] / 2
   local t = 0
   local r = 30000

   for index = 1, 6 do
      targetlist[index + 0] = {
         position = {x + r * cos(t), y + r * sin(t)}
      }
      t = t + 3.141579 / 180 * 360 / 6;
   end
end

boosters = {
   { position = {6144 * 3, 6144 * 7} },
   { position = {6144 * 7, 6144 * 3} },
   { position = {6144 * 7, 6144 * 7} },
   { position = {6144 * 3, 6144 * 3} },
};

jumpers = {
   { position = {6144 * 4, 6144 * 6}, direct = {1.0, 0.3}  },
   { position = {6144 * 6, 6144 * 4}, direct = {1.0, 0.3}  },
   { position = {6144 * 4, 6144 * 4}, direct = {1.0, 0.3}  },
   { position = {6144 * 6, 6144 * 6}, direct = {1.0, 0.3}  },
};

itemboxes = {
   { position = {6144 * 2, 6144 * 2} },
};

npc_rounders = {
   { positions = {{0, 0}, {50, 50}, {80, 80}, {90, 0}}; velocity = 500.0; rect = {-100, -100, 100, 100};},
   { positions = {{0, 0}, {50, 50}, {80, 80}, {90, 0}}; velocity = 500.0; rect = {-100, -100, 100, 100};},
   { positions = {{0, 0}, {50, 50}, {80, 80}, {90, 0}}; velocity = 500.0; rect = {-100, -100, 100, 100};},
   { positions = {{0, 0}, {50, 50}, {80, 80}, {90, 0}}; velocity = 500.0; rect = {-100, -100, 100, 100};},
};

npc_buoys = {
   { position = {0, 0}; rect = {0, 0, 50, 50};},
};
